home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / clib / socket_protos.h < prev    next >
C/C++ Source or Header  |  1994-10-04  |  5KB  |  170 lines

  1. #ifndef CLIB_SOCKET_PROTOS_H
  2. #define CLIB_SOCKET_PROTOS_H \
  3.        "$Id: socket_protos.h,v 4.3 1994/10/04 17:09:14 jraja Exp $"
  4. /*
  5.  *      Prototypes of AmiTCP/IP bsdsocket.library
  6.  * 
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif
  15.  
  16. #ifndef SYS_TYPES_H
  17. #include <sys/types.h>
  18. #endif
  19.  
  20. #ifndef SYS_TIME_H
  21. #include <sys/time.h>
  22. #endif
  23.  
  24. #ifndef SYS_SOCKET_H
  25. #include <sys/socket.h>
  26. #endif
  27.  
  28. #ifndef NETINET_IN_H
  29. #include <netinet/in.h>
  30. #endif
  31.  
  32. #ifndef AMITCP_NEW_NAMES
  33. #define STDSOCKAPI
  34. #define Socket socket
  35. #define Bind bind
  36. #define Listen listen
  37. #define Accept accept
  38. #define Connect connect
  39. #define Send send
  40. #define SendTo sendto
  41. #define SendMsg sendmsg
  42. #define Recv recv
  43. #define RecvFrom recvfrom
  44. #define RecvMsg recvmsg
  45. #define Shutdown shutdown
  46. #define SetSockOpt setsockopt
  47. #define GetSockOpt getsockopt
  48. #define GetSockName getsockname
  49. #define GetPeerName getpeername
  50. #define Inet_Addr inet_addr
  51. #define Inet_Network inet_network
  52. #define GetHostByName gethostbyname
  53. #define GetHostByAddr gethostbyaddr
  54. #define GetNetByName getnetbyname
  55. #define GetNetByAddr getnetbyaddr
  56. #define GetServByName getservbyname
  57. #define GetServByPort getservbyport
  58. #define GetProtoByName getprotobyname
  59. #define GetProtoByNumber getprotobynumber
  60. #define GetDTableSize getdtablesize
  61. #define GetHostName gethostname
  62. #define GetHostId gethostid
  63. #define SyslogA vsyslog
  64. #define Syslog syslog
  65. #endif
  66.  
  67. LONG Socket(LONG domain, LONG type, LONG protocol);
  68. LONG Bind(LONG s, const struct sockaddr *name, LONG namelen);
  69. LONG Listen(LONG s, LONG backlog);
  70. LONG Accept(LONG s, struct sockaddr *addr, LONG *addrlen);
  71. LONG Connect(LONG s, const struct sockaddr *name, LONG namelen);
  72. LONG Send(LONG s, const UBYTE *msg, LONG len, LONG flags);
  73. LONG SendTo(LONG s, const UBYTE *msg, LONG len, LONG flags, 
  74.           const struct sockaddr *to, LONG tolen);
  75. LONG SendMsg(LONG s, struct msghdr * msg, LONG flags);
  76. LONG Recv(LONG s, UBYTE *buf, LONG len, LONG flags);    /* V3 */
  77. LONG RecvFrom(LONG s, UBYTE *buf, LONG len, LONG flags, 
  78.             struct sockaddr *from, LONG *fromlen);
  79. LONG RecvMsg(LONG s, struct msghdr * msg, LONG flags);    /* V3 */
  80. LONG Shutdown(LONG s, LONG how);
  81. LONG SetSockOpt(LONG s, LONG level, LONG optname, 
  82.              const void *optval, LONG optlen);
  83. LONG GetSockOpt(LONG s, LONG level, LONG optname, 
  84.              void *optval, LONG *optlen);
  85. LONG GetSockName(LONG s, struct sockaddr *name, LONG *namelen);
  86. LONG GetPeerName(LONG s, struct sockaddr *name, LONG *namelen);
  87.  
  88. LONG IoctlSocket(LONG d, ULONG request, char *argp);
  89. LONG CloseSocket(LONG d);
  90. LONG WaitSelect(LONG nfds, fd_set *readfds, fd_set *writefds, fd_set *exeptfds,
  91.         struct timeval *timeout, ULONG *maskp);
  92.  
  93. LONG Dup2Socket(LONG fd1, LONG fd2);               /* V2 */
  94.  
  95. LONG GetDTableSize(void);                   /* V3 */
  96. void SetSocketSignals(ULONG SIGINTR, ULONG SIGIO, ULONG SIGURG);
  97. LONG SetErrnoPtr(void *errno_p, LONG size);
  98. LONG SocketBaseTagList(struct TagItem *tagList);    /* V3 */
  99. LONG SocketBaseTags(...);                /* V3 */
  100.  
  101. LONG GetSocketEvents(ULONG *eventmaskp);        /* V4 */
  102.  
  103. LONG Errno(void);
  104.  
  105. LONG GetHostName(STRPTR hostname, LONG size);          /* V3 */
  106. ULONG GetHostId(void);                       /* V3 */
  107.  
  108. LONG ObtainSocket(LONG id, LONG domain, LONG type, LONG protocol);
  109. LONG ReleaseSocket(LONG fd, LONG id);
  110. LONG ReleaseCopyOfSocket(LONG fd, LONG id);
  111.  
  112. /* Arpa/inet functions */
  113. ULONG Inet_Addr(const UBYTE *);
  114. ULONG Inet_Network(const UBYTE *);
  115. char *Inet_NtoA(ULONG s_addr);
  116. ULONG Inet_MakeAddr(ULONG net, ULONG lna);
  117. ULONG Inet_LnaOf(LONG s_addr);
  118. ULONG Inet_NetOf(LONG s_addr);
  119.  
  120. /* NetDB functions */
  121. struct hostent  *GetHostByName(const UBYTE *name);
  122. struct hostent  *GetHostByAddr(const UBYTE *addr, LONG len, LONG type);
  123. struct netent   *GetNetByName(const UBYTE *name);
  124. struct netent   *GetNetByAddr(LONG net, LONG type);
  125. struct servent  *GetServByName(const UBYTE *name, const UBYTE *proto);
  126. struct servent  *GetServByPort(LONG port, const UBYTE *proto);
  127. struct protoent *GetProtoByName(const UBYTE *name);
  128. struct protoent *GetProtoByNumber(LONG proto);
  129.  
  130. /* Syslog functions */
  131. void SyslogA(ULONG pri, const char *fmt, LONG *);
  132. void Syslog(ULONG pri, const char *fmt, ...);
  133.  
  134. #ifdef STDSOCKAPI
  135. #undef STDSOCKAPI
  136. #undef Socket
  137. #undef Bind
  138. #undef Listen
  139. #undef Accept
  140. #undef Connect
  141. #undef Send
  142. #undef SendTo
  143. #undef SendMsg
  144. #undef Recv
  145. #undef RecvFrom
  146. #undef RecvMsg
  147. #undef Shutdown
  148. #undef SetSockOpt
  149. #undef GetSockOpt
  150. #undef GetSockName
  151. #undef GetPeerName
  152. #undef Inet_Addr
  153. #undef Inet_Network
  154. #undef GetHostByName
  155. #undef GetHostByAddr
  156. #undef GetNetByName
  157. #undef GetNetByAddr
  158. #undef GetServByName
  159. #undef GetServByPort
  160. #undef GetProtoByName
  161. #undef GetProtoByNumber
  162. #undef GetDTableSize
  163. #undef GetHostName
  164. #undef GetHostId
  165. #undef SyslogA
  166. #undef Syslog
  167. #endif
  168.  
  169. #endif /* !CLIB_SOCKET_PROTOS_H */
  170.